package com.xgz.service.aware;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * awarexxx 测试
 * @author xgz
**/
@Component
public class AwareBean implements ApplicationContextAware, MessageSourceAware, BeanNameAware {

	private String beanName;
	private ApplicationContext applicationContext;
	private MessageSource messageSource;

	@Autowired
	private Environment environment;



	public String getBeanName() {
		return beanName;
	}
	public ApplicationContext getApplicationContext() {
		return applicationContext;
	}
	public MessageSource getMessageSource() {
		return messageSource;
	}


	@Override
	public void setBeanName(String name) {
		this.beanName = name;
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}


	@Override
	public void setMessageSource(MessageSource messageSource) {
		this.messageSource = messageSource;
	}

}
